<!-- 换模板 -->
<!-- <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <link rel="stylesheet" href="eg.css">
</head>
<body>
  <div class="a">
    <div class="fg">
      <button class="fg" id="ji">改改改</button>
    </div>
  </div>
  <div class="s">
    
    <p class="fg">fervent</p>
  </div>
  <div class="d">
    
    <h1 class="fg">圣达菲</h1>
  </div>
  <p>sdf</p>
  <script src="js/jquery.min.js"></script>
  <script>
    $(function() {
      $('#ji').on('click', function() {
        var cla = $(this).prop('class');
        var c = "."+cla;
        console.log(c);
        $(c).prop('class', 'gh');
        $(c).remove();
      })
    })
  </script>
</body>
</html> --> 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;">
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <div id="map" style="width: 100%;"></div>
    
    <iframe id="test" src="https://m.amap.com/picker/?center=116.3972,39.9696&key=013ba28253e208d823d400af76d85aa0" style="height:600px"></iframe>

    <!-- <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=013ba28253e208d823d400af76d85aa0"></script> -->
    <!-- <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script> -->
    <script>
        
        
        (function(){
            var iframe = document.getElementById('test').contentWindow;
            document.getElementById('test').onload = function(){
                iframe.postMessage('hello','https://m.amap.com/picker/');
            };
            window.parent.onmessage = function(e){
                alert('您选择了:' + e.data.name + ',' + e.data.location)
            };
        }())
    

        var mock = {
            log: function(result) {
                window.parent.setIFrameResult('log', result);
            }
        }
        console = mock;
        window.Konsole = {
            exec: function(code) {
                code = code || '';
                try {
                    var result = window.eval(code);
                    window.parent.setIFrameResult('result', result);
                } catch (e) {
                    window.parent.setIFrameResult('error', e);
                }
            }
        }


        // var map = new AMap.Map('map', {
        //   resizeEnable: true,
        //   zoom: 15,
        //   center: [location,location]
        // });
        // AMap.plugin(['AMap.ToolBar', 'Amap.Scale', 'Amap.OverView'],
        //   function() {
        //     map.addControl(new Amap.ToolBar());
        //     map.addControl(new Amap.Scale());
        //     map.addControl(new AMap.OverView({isOpen:true}));
        //   }
        //   )
        // var marker = new AMap.Marker({map:map});
    </script>
</body>
</html>